home *** CD-ROM | disk | FTP | other *** search
- ;------------------------------------------------------------------------
- ;This document contains a list of extended BIOS functions available on
- ;the Everex Viewpoint VGA. This set of functions is slightly different
- ;from thoses available on the EVGA. This new set of Everex Extended
- ;functions will become a standard fixture in future Everex EGA/VGA BIOS.
- ;In particular, the 'Get mode supported info for current' (BX=0005h) and
- ;'Get paging function pointer for current mode' (BX=0004h) will allow
- ;well written applications to work on all Everex cards, regardless of
- ;future hardware enhancements.
- ;------------------------------------------------------------------------
- ;Everex Extended Set Mode function:
- ;(This function applies across all Everex EGA and VGA graphics adapters.)
- ; mov ax,0070h ;(b7 of AL still acts as save regen)
- ; mov bl,02h ;Example Everex mode: 800x600 16 color
- ; int 10h
- ;------------------------------------------------------------------------
- ;For all functions, AX = 7000h on entry, and AL = 70h on exit if function
- ;was successful.
- ;
- ; bx = 00h: return emulation status
- ; Exit:
- ; - cl = monitor type
- ; 00 = mono
- ; 01 = cga
- ; 02 = ega
- ; 03 = dmf
- ; 04 = IBM PS/2
- ; 05 = IBM 8514
- ; 06 = amf
- ; 07 = amf
- ; - ch (b0) = 6845 emulation
- ; (b1,3) = unused (0)
- ; (b4) = VGA Protect enabled
- ; (b5) = Special oscillator present (44.9MHz for Ev678)
- ; (b6,7) = 256K/512K/1024K/2048K
- ; - dx = BCD board id (b15..b4: model, b3..b0: revision)
- ; - di = BCD BIOS version number
- ;
- ; bx = 01h: Set operating mode
- ; Entry: ch = 00h disable 6845 emulation (default)
- ; = 01h enable 6845 emulation
- ;
- ; bx = 02h: VGA register protect
- ; Entry: ch = 00h to unprotect CRTC 00.07,10..17,MiscOutp (default)
- ; ch = 01h to protect
- ;
- ; bx = 03h: Enable/Disable fast mode
- ; Entry: ch = 00h to disable fast
- ; ch = 01h to enable fast (default)
- ;
- ; bx = 04h: Get paging function pointer for current mode
- ; Exit:
- ; - ES:DI -> paging function
- ; DL = page to set on entry to any paging function
- ; word preceding [ES:DI] is length of function
- ; last byte of function is RETF
- ; (Code can be FAR CALLed, or copied to application
- ; buffer space and patched to a NEAR CALL.)
- ;
- ; bx = 05h: Get mode supported info for current
- ; Entry: cl = Maximum number of modes to get info for
- ; dl = monitor type to get mode info for
- ; es:di -> buffer of sufficient size
- ; ch = Mode type to get info for:
- ; = 00h to get all modes
- ; = 01h to get mono text modes
- ; = 02h to get color text modes
- ; = 03h to get 4 color (CGA) grfx modes
- ; = 04h to get 1 color (CGA) grfx modes
- ; = 05h to get 16 (planar) color grfx modes
- ; = 06h to get 256 color grfx modes
- ; Exit:
- ; - cl = Total number of modes fitting criteria
- ; - ch = Size of each record
- ; Info record format:
- ; (b) - Mode number (b7 set if it is an extended mode)
- ; (b) - Mode format (same definition as ch above)
- ; (b) - Info bits
- ; (b0) - paged mode
- ; (b1,2) Requires 256K/512K/1024K/2048K
- ; (b3) - Requires special oscillator (44.9MHz for Ev678)
- ; (b4) - Interlaced mode
- ; (b5) - monochrome mode
- ; (b6.7) - reserved
- ; (b) - font height
- ; (b) - Columns on screen (text format)
- ; (b) - Rows on screen (text format)
- ; (w) - Number of scan lines
- ; (b) - Color info
- ; (b0.3) Bits per pixel
- ; (b4.7) reserved (0)
- ;
- ; bx = 06h: Program mode parameters
- ; Entry: ES:DI -> Standard 64-byte mode table
- ; DS:DX -> Extra register table
- ;
- ; bx = 09h:Everex Backdoor Set Mode (for dealing with obnoxious mice)
- ; Entry: ch = Setmode al
- ; cl = Setmode bl
- ;------------------------------------------------------------------------
-
- -------------------------------------------------------------------------
- -------------------------------------------------------------------------
-
- ;------------------------------------------------------------------------
- ;Example program which sets Everex Extended Mode 15h, 512x480 256 color
- ;and draws a box around the perimeter of the screen. This code uses
- ;Everex Extended BIOS function 0004h to get the paging function pointer
- ;for the particular card installed. This code works on the Everex EVGA
- ;(Ev673), Everex Viewpoint VGA (Ev678), and the Everex Ultragraphics II
- ;VGA (Ev236), as well as all future Everex VGA cards, since it uses the
- ;device independent paging function pointer to perform memory paging.
- ;------------------------------------------------------------------------
- ;The paging function is used to change which 64K bank of memory is mapped
- ;into the CPU address space at segment A000. The banks start at 0 at the
- ;top of the screen, and increment towards the bottom of the screen. Each
- ;bank is 64K in size and is read/writeable. This paging function code can
- ;be applied to high-resolution 16-color modes as well.
- ;------------------------------------------------------------------------
-
- CR equ 0Dh
- LF equ 0Ah
-
- rSequAddr equ 3C4h
- rRMiscOutp equ 3CCh
- rWMiscOutp equ 3C2h
-
- ;------------------------------------------------------------------------
-
- cseg segment word public 'CODE'
-
- assume cs:cseg
- assume ds:cseg
- assume es:cseg
-
- ;------------------------------------------------------------------------
-
- org 0100h
-
- Start:
- mov bx,0000h ;Everex Extended BIOS Get Status
- mov ax,7000h
- int 10h ;Find out if Everex card is present
- ;and what kind it is.
-
- cmp al,70h ;Abort if not Everex VGA card
- je EverexCardDetected
- jmp EverexCardNotPresent
-
- EverexCardDetected:
- mov ax,0070h
- mov bl,15h ;Set Everex Extended 512x480 256-color
- int 10h ;mode. Assume that setmode succeeds.
-
- and dx,0FFF0h ;Check card type from Get Status call
- cmp dx,6730h ;Is it an EVGA?
- je SkipGetPaging
-
- ;Note that paging function is called
- ;AFTER the setmode above.
- mov bx,0004h ;Everex Extended Get Paging Function
- mov ax,7000h
- int 10h
-
- cmp al,70h
- je CopyPagingFunction
- jmp CantGetPageFunc ;Abort if paging function not supported
-
- CopyPagingFunction:
- mov si,es
- mov ds,si
- mov si,di ;DS:SI -> Paging function in ROM
-
- mov di,cs
- mov es,di
- mov di,offset ProgPage ;Point to our internal function
-
- mov cx,ds:[si-02h] ;Get size of function in bytes
-
- rep movsb ;Copy function to our memory
-
- mov al,cs:[ExampleRET]
- mov es:[di-01h],al ;Patch RETF to RET
-
- SkipGetPaging: ;Re-entry here for EVGA
- ;We're now in 512x480 256-color mode
- ;and ProgPage contains a paging function
- ;for the current Everex VGA card, so
- ;let's draw the box.
-
- mov di,0A000h
- mov es,di ;ES = segment of graphics memory
-
-
- mov dl,00h ;Note that 512x480 has a neat performance
- call SetPage ;advantage in that 512 is a power of 2,
- ;and thus divides into 65536 (64K) evenly.
- ;In other words, one 64K bank contains
- ;exactly 128 scan lines, whereas a 640
- ;wide mode has a fractional scan line.
-
- mov di,0000h ;Point to first scan line
- mov cx,512d/2 ;Fill 512/2 = 256 words
- mov ax,0707h ;Fill with white pixels
- rep stosw ;Draw top horizontal line
-
-
- mov ax,479d ;This is an easy example of how to calculate
- mov dx,512d ;The page and offset of a scanline or pixel
- mul dx ;479 is the scan line we want, and each scan
- ;line is 512 bytes wide.
- add ax,0000h ;Add in the starting X pixel. (This isn't
- adc dl,00h ;much here, since X is 0, but it's given as
- ;and example.)
- call SetPage ;Now AX = offset within the bank, and DL
- ;contains the bank number we need to map
- ;into our window.
- mov di,ax ;Point to last scan line
- mov cx,512d/2 ;Fill 512/2 = 256 words
- mov ax,0707h ;Fill with white pixels
- rep stosw ;Draw bottom horizontal line
-
-
- mov dl,00h
- call SetPage ;Map in top bank
-
- mov di,0000h ;Point to upper left corner of screen
- mov bx,512d ;Offset from one pixel to the one below it.
- mov cx,480d ;Number of pixels to do vertically
- mov al,07h ;Draw white pixels
-
- DrawLeftSideLoop:
- mov es:[di],al ;Draw one pixel
- add di,bx ;Move down to next
- jnc DrawLeftSideCont ;Did we move past the end of a segment
-
- inc dl ;Yes, so move to next page
- call SetPage
-
- DrawLeftSideCont:
- loop DrawLeftSideLoop ;and loop
-
-
- mov dl,00h
- call SetPage ;Map in top bank
-
- mov di,511d ;Point to upper right corner of screen
- mov bx,512d ;Offset from one pixel to the one below it.
- mov cx,480d ;Number of pixels to do vertically
- mov al,07h ;Draw white pixels
-
- DrawRightSideLoop:
- mov es:[di],al ;Draw one pixel
- add di,bx ;Move down to next
- jnc DrawRightSideCont ;Did we move past the end of a segment
-
- inc dl ;Yes, so move to next page
- call SetPage
-
- DrawRightSideCont:
- loop DrawRightSideLoop ;and loop
-
-
- mov dl,00h ;Map bank back to top bank
- call SetPage
-
- mov dx,cs
- mov ds,dx
- mov dx,offset ProgramDoneMesg
- mov ah,09h
- int 21h
-
- mov ax,4C00h ;Return code OK
- int 21h ;Program done
-
- ;------------------------------------------------------------------------
-
- EverexCardNotPresent: ;Abort if not Everex VGA card
- mov dx,offset NotEverexCardMesg
- jmp short OutputErrorMesg
-
- CantGetPageFunc: ;Abort if paging function not supported
- mov dx,offset CantGetPageMesg
- OutputErrorMesg:
- mov ax,cs
- mov ds,ax
- mov ah,09h
- int 21h
-
- mov ax,4C01h ;Exit with error return code
- int 21h
-
- ;------------------------------------------------------------------------
-
- ActivePage db 00h ;Global variable holding current bank number
-
- ProgramDoneMesg label byte
- db 'Program successful.',CR,LF,'$'
-
- NotEverexCardMesg label byte
- db 'ERROR: Everex VGA card not detected.',CR,LF,'$'
-
- CantGetPageMesg label byte
- db 'ERROR: Can not obtain Everex paging function.',CR,LF,'$'
-
- ;------------------------------------------------------------------------
- ;Memory paging function for Everex EVGA (Ev673) for Everex Extended
- ;256-color modes. Note that this code only works on the EVGA. For
- ;other Everex VGA cards, this code will be overwritten with the
- ;paging function code for the particular Everex VGA card installed.
- ;------------------------------------------------------------------------
- ;Entry: DL = page number to select
-
- SetPage proc near
-
- mov cs:[ActivePage],dl ;Keep a copy around for other
- ;functions to look at, like mouse
- ;handlers.
- ProgPage proc near
-
- push dx
- push bx
- push ax
-
- mov bl,dl
- mov bh,dl
-
- mov dx,rSequAddr ; Set page bit in Sequencer
- mov al,8 ; This selects between 0,2 and 1,3
- mov ah,al ; Save for later reference
- out dx,al
- inc dx
- jmp short $+2
- in al,dx ; Get old value
-
- ror bl,1
- and bl,80h
- and al,7fh
- or al,bl
-
- xchg ah,al ; AL = EvrxCtrl1, AH = new bits
- dec dx
- out dx,ax
- jmp short $+2
-
- and bh,2
- shl bh,1
- shl bh,1
- shl bh,1
- shl bh,1
-
- xor bh,20h ; Invert bit
- mov dx,rRMiscOutp ; Now read other register
- in al,dx
- mov dx,rWMiscOutp
-
- and al,0DFh
- or al,bh
- out dx,al
-
- pop ax
- pop bx
- pop dx
- ret
-
- db (100 - ($ - offset ProgPage)) dup (00h)
- ;Pad buffer out to 256 bytes
- ;for copying paging code in here.
-
- ExampleRet label byte ;Used to patch the RETF in the paging
- ret ;code to a RET for near calls to
- ;ProgPage
- ProgPage endp
-
- SetPage endp
-
- ;------------------------------------------------------------------------
-
- cseg ends
-
- end Start
-
- ;------------------------------------------------------------------------
-
- -------------------------------------------------------------------------
- -------------------------------------------------------------------------
-
-
-
- {-----------------------------------------------------------------------}
- { Program to get from the BIOS and any EV-678 mode TSR present a list }
- { of all of the modes supported for a particular monitor. It also }
- { reads the state of the board. It does this by calling the two }
- { Everex Extended BIOS functions below: }
- {-----------------------------------------------------------------------}
- { bx = 00h: return emulation status }
- { - cl = monitor type }
- { - ch (b0) = 6845 emulation }
- { - (b1,3) = unused (0) }
- { - (b4) = VGA Protect enabled }
- { - (b5) = 44.9MHz present }
- { - (b6,7) = 256K/512K/1024K/2048K }
- { - dx = BCD board id (b15..b4: model, b3..b0: revision) }
- { - di = BCD BIOS version number }
- {-----------------------------------------------------------------------}
- { bx = 05h: Get mode supported info for current }
- { Entry: cl = Maximum number of modes to get info for }
- { dl = monitor type to get mode info for }
- { es:di -> buffer of sufficient size }
- { ch = Mode type to get info for: }
- { = 00h to get all modes }
- { = 01h to get mono text modes }
- { = 02h to get color text modes }
- { = 03h to get 4 color (CGA) grfx modes }
- { = 04h to get 1 color (CGA) grfx modes }
- { = 05h to get 16 color grfx modes }
- { = 06h to get 256 color grfx modes }
- { - cl = Total number of modes fitting criteria }
- { - ch = Size of each record }
- { Info record format: }
- { (b) - Mode number (b7 set if it is an extended mode)}
- { (b) - Mode format (same definition as ch above) }
- { (b) - Info bits }
- { (b0) - paged mode }
- { (b1,2) Requires 256K/512K/1024K/2048K }
- { (b3) - Requires 44.9MHz }
- { (b4) - Interlaced mode }
- { (b5) - monochrome mode }
- { (b6.7) - reserved }
- { (b) - font height }
- { (b) - Columns on screen (text format) }
- { (b) - Rows on screen (text format) }
- { (w) - Number of scan lines }
- { (b) - Color info }
- { (b0.3) Bits per pixel }
- { (b4.7) reserved (0) }
- { bx = 05h: Get mode supported info for current }
- { Entry: cl = Maximum number of modes to get info for }
- { dl = monitor type to get mode info for }
- { es:di -> buffer of sufficient size }
- { ch = Mode type to get info for: }
- { = 00h to get all modes }
- { = 01h to get mono text modes }
- { = 02h to get color text modes }
- { = 03h to get 4 color (CGA) grfx modes }
- { = 04h to get 16 color grfx modes }
- { = 05h to get 256 color grfx modes }
- { - cl = Total number of modes fitting criteria }
- { - ch = Size of each record }
- { Info record format: }
- { (b) - Mode number (b7 set if it is an extended mode)}
- { (b) - Mode format (same definition as ch above) }
- { (b) - Info bits }
- { (b0) - paged mode }
- { (b1,2) Requires 256K/512K/1024K/2048K }
- { (b3) - Requires 44.9MHz }
- { (b4) - Interlaced mode }
- { (b5) - monochrome mode }
- { (b6.7) - reserved }
- { (b) - font height }
- { (b) - Columns on screen (text format) }
- { (b) - Rows on screen (text format) }
- { (w) - Number of scan lines }
- { (b) - Color info }
- { (b0.3) - Bits per color }
- { (b4.7) - reserved (0) }
- {-----------------------------------------------------------------------}
-
- uses
- dos;
-
- {-----------------------------------------------------------------------}
-
- type
- s64 = string[64];
-
- Ev678ModeInfoType = record
- mode : byte;
- memorg : byte;
- info : byte;
- points : byte;
- columns : byte;
- rows : byte;
- scanline: word;
- color : byte;
- end;
-
- {-----------------------------------------------------------------------}
-
- const
- MonitorType : array [$00..$07] of s64 =
- ('Monochrome',
- 'CGA',
- 'EGA',
- 'TTL multifrequency',
- 'IBM PS/2 fixed frequency',
- 'IBM 8514 fixed frequency',
- 'Analog multifrequency',
- 'Analog multifrequency');
-
- EmulationType : array [$00..$01] of s64 =
- ('Standard VGA',
- '6845 emulation');
-
- MemorySizeType : array [$00..$03] of s64 =
- (' 256K',
- ' 512K',
- '1024K',
- '2048K');
-
- ProtectType : array [$00..$01] of s64 =
- ('VGA registers unprotected',
- 'VGA registers protected');
-
- CrystalPresentType : array [$00..$01] of s64 =
- ('44.9MHz crystal not present',
- '44.9MHz crystal present');
-
- MemoryOrgType : array [$00..$08] of s64 =
- ('Invalid ',
- 'Mono Txt ',
- 'Colr Txt ',
- '4 Grfx ',
- '2 Grfx ',
- 'Planar ',
- '256 Grfx ',
- 'Unknown ',
- 'Unknown ');
-
- CrystalNeededType : array [$00..$01] of s64 =
- (' ',
- '44.9MHz');
-
- InterlacedType : array [$00..$01] of s64 =
- (' ',
- 'intrlcd');
-
- PagedType : array [$00..$01] of s64 =
- (' ',
- 'paged');
-
- ColorMonoType : array [$00..$01] of s64 =
- ('C',
- 'M');
-
- {-----------------------------------------------------------------------}
-
- var
- reg : Registers;
- i : byte;
-
- modeptr : ^Ev678ModeInfoType;
- indxptr : ^Ev678ModeInfoType;
- modesize: byte;
- modenum : byte;
- modeind : byte;
-
- {-----------------------------------------------------------------------}
- {-----------------------------------------------------------------------}
-
- function decval(decnum : real) : s64;
-
- const table : array [0..15] of char = ('0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F');
-
- begin
- decval := table[trunc(decnum)];
- end;
-
- function dectohex(decnum : real) : s64;
-
- begin
- if decnum >= 16.0 then begin
- dectohex := dectohex(decnum/16) + decval(decnum - 16.0*trunc(decnum/16.0));
- end else
- dectohex := decval(decnum);
- end;
-
- function hex(decnum : real) : s64;
-
- var i : byte;
- tmp : s64;
-
- begin
- tmp := dectohex(decnum);
- for i := 1 to 2-Length(tmp) do
- tmp := '0'+tmp;
- tmp := tmp+'h';
- hex := tmp;
- end;
-
- {-----------------------------------------------------------------------}
- {-----------------------------------------------------------------------}
-
- begin
- reg.AX := $7000;
- reg.BX := $0000; { Get card info }
- Intr($10,reg);
-
- if (reg.AL<>$70) then begin
- writeln('Everex Extended BIOS calls not supported.');
- halt(1);
- end;
- if ((reg.DX and $FFF0)=$6730) then begin
- writeln('Everex EVGA (EV673) does not support mode info function.');
- halt(1);
- end;
-
- write('Adapter : EV-');
- for i := 0 to 2 do begin
- write(chr(((reg.DX shr $0C) and $0F) + ord ('0')));
- reg.DX := reg.DX shl $04;
- end;
- writeln;
-
- write('BIOS Version: v');
- for i := 0 to 2 do begin
- reg.DI := reg.DI shl $04;
- write(chr(((reg.DI shr $0C) and $0F) + ord ('0')));
- if (i=0) then
- write('.');
- end;
- writeln;
-
- writeln('Monitor Type: ',MonitorType[reg.cl]);
- writeln('Emulation : ',EmulationType[reg.ch and $01]);
- writeln('Memory Size : ',MemorySizeType[(reg.ch shr 6) and $03]);
- writeln('Protection : ',ProtectType[(reg.ch shr 4) and $01]);
- writeln('44.9MHz : ',CrystalPresentType[(reg.ch shr 5) and $01]);
-
- reg.AX := $7000;
- reg.BX := $0005; { Get mode info }
- reg.DL := reg.CL; { Get mode info for current monitor }
- reg.CL := $00; { Get 00 modes on the first call }
- reg.CH := $00; { Get all modes }
- Intr($10,reg);
-
- modenum := reg.CL; { Get total number of modes }
- modesize:= reg.CH; { Get size of each record }
-
- GetMem(modeptr,modenum*modesize);
-
- reg.AX := $7000;
- reg.CH := $00; { Get all modes }
- reg.ES := Seg(modeptr^);
- reg.DI := Ofs(modePtr^);
- Intr($10,reg); { Get all mode info }
-
- for modeind := 0 to modenum-1 do begin
-
- indxptr := Ptr(Seg(modeptr^),Ofs(modeptr^)+modeind*modesize);
-
- with indxptr^ do begin
- if(mode>=$80) then
- write('x')
- else
- write(' ');
- write(hex(mode and $7F),' ');
-
- write(MemoryOrgType[memorg],' ');
-
- write(columns:3,'x');
-
- write(rows:2,' ');
-
- if ((points and $80) = $80) then
- write('9')
- else
- write('8');
- write('x',(points and $3F):2,' ');
-
- if ((points and $80) = $80) then
- write(9*columns:4)
- else
- write(8*columns:4);
- write('x',scanline:3);
- write('x',(color and $0F):1,' ');
-
- write(ColorMonoType[(info shr 5) and $01],' ');
- write(MemorySizeType[(info shr 1) and $03],' ');
- write(CrystalNeededType[(info shr 3) and $01],' ');
- write(PagedType[info and $01],' ');
- write(InterlacedType[(info shr 4) and $01],' ');
-
- end; {with}
-
- writeln;
-
- end; {for}
-
- end.
-
- {-----------------------------------------------------------------------}
- {-----------------------------------------------------------------------}
- {-----------------------------------------------------------------------}
- {-----------------------------------------------------------------------}
-
-
- {-----------------------------------------------------------------------}
- { The following code is an example of how to recognize older Everex }
- { EGA/VGA cards, so that software can be written to be backwards }
- { compatible across all cards, if necessary. }
- {-----------------------------------------------------------------------}
- { The following sample code can be used to recognize the type of Everex }
- { EGA/VGA card installed, and thus allow an application program to }
- { figure out which Everex extended resolution modes are available. }
- {-----------------------------------------------------------------------}
- { For more information, call the Everex BBS at (415) 683-2984. }
- {-----------------------------------------------------------------------}
- { NOTE: This code does not make a determination of the physical monitor }
- { type. It is not possible to determine the physical monitor }
- { type (the monitor actually attached to the adapter) for an EV-657 or }
- { EV-659. It is possible to determine the physical monitor for the }
- { EV-673 by saving the value in register CL following the INT 10h call }
- { below (**). This could be of use to disallow the user from selecting }
- { an Everex Extended mode which could damage the monitor. }
- {-----------------------------------------------------------------------}
- { The following abbreviations are used below: }
- { }
- { MON - TTL monochrome monitor }
- { CGA - CGA compatible monitor }
- { EGA - EGA compatible monitor }
- { DMF - Digital (TTL) multi-frequency monitor }
- { DMF#1 - Digital (TTL) multi-frequency monitor (e.g. NEC) }
- { DMF#2 - Digital (TTL) multi-frequency monitor (e.g. Sony) }
- { PS2 - IBM PS/2 fixed frequency monitor }
- { AMF - Analog multi-frequency monitor }
- { AMF#1 - Analog multi-frequency monitor (e.g. NEC) }
- { AMF#2 - Analog multi-frequency monitor (e.g. Sony) }
- { }
- { Note that the DMF#1, DMF#2, AMF#1, and AMF#2 abbreviations are only }
- { used to distinguish monitor types better for the EV-673. The DMF }
- { (AMF) abbreviation is used whenever both DMF#1 and DMF#2 (AMF#1 and }
- { AMF#2) are supported in that resolution. }
- {-----------------------------------------------------------------------}
- { Everex Extended modes can be set by calling INT 10h with the following}
- { parameters: }
- { }
- { AH = 00h ; IBM standard set mode call }
- { AL = 70h ; Special flag signifying Everex Extended }
- { BL = mode# ; Mode number listed below }
- { }
- { Note that all modes are resident in the ROM, so there are no external }
- { tables or extra programming to handle. Bit #7 of AL still works as }
- { a save regen buffer flag. Also, the mode number placed in 0:449h in }
- { the BIOS data area will be the mode number of a compatible IBM }
- { standard mode (03h for color text, 07h for mono text, 10h for 16 }
- { color, 13h for 256 color.) }
- {-----------------------------------------------------------------------}
- { The following modes are supported by all 8 cards (EV657_1, EV657_2, }
- { EV657_3, EV657_B, EV659, EV659_2600, EV659_2, EV673): }
- { }
- {Evrx Extd Type Resolution Font Monitors }
- {========= ==== ========== ==== ======== }
- { 00h 16 color grfx 640x480 8x14 AMF,DMF,PS2 }
- { 01h 16 color grfx 752x410 8x14 AMF,DMF }
- { 03h color text 80x34 8x14 AMF,DMF,PS2 }
- { 04h color text 80x60 8x8 AMF,DMF,PS2 }
- { 05h color text 94x29 8x14 AMF,DMF }
- { 06h color text 94x51 8x8 AMF,DMF }
- { 09h color text 80x44 8x8 AMF,DMF,PS2,EGA }
- { 0Ah color text 132x25 ?x14 AMF,DMF,PS2,EGA }
- { 0Bh color text 132x44 ?x8 AMF,DMF,PS2,EGA }
- { 0Ch color text 132x25 ?x8 AMF,DMF,PS2,EGA,CGA}
- { 0Dh mono text 80x44 8x8 AMF,DMF,PS2,MON }
- { 0Eh mono text 132x25 ?x14 AMF,DMF,PS2,MON }
- { 0Fh mono text 132x44 ?x8 AMF,DMF,PS2,MON }
- { 10h mono text 132x25 ?x8 AMF,DMF,PS2 }
- { The ? in the font column denotes that the font width may be 5, 6 or }
- { 8 dots. This is not of importance unless a user program loads up }
- { alternate fonts. }
- {-----------------------------------------------------------------------}
- { The following modes are supported by the EV657_3, EV659_2600, EV659_2,}
- { and EV673: }
- { }
- {Evrx Extd Type Resolution Font Monitors }
- {========= ==== ========== ==== ======== }
- { 02h 16 color grfx 800x600 8x14 AMF,DMF }
- { 07h color text 100x43 8x14 AMF,DMF }
- { 08h color text 100x75 8x8 AMF,DMF }
- {-----------------------------------------------------------------------}
- { The following modes are supported by the EV659_2600 and EV673: }
- { }
- {Evrx Extd Type Resolution Font Monitors }
- {========= ==== ========== ==== ======== }
- { 11h 4 color grfx 1280x350(1) 8x14 DMF,EGA }
- { 12h 4 color grfx 1280x600(1) 8x14 DMF }
- { 16h color text 80x30 8x16 AMF,DMF,PS2 }
- { 17h color text 94x25 8x16 AMF,DMF }
- { 18h color text 100x37 8x16 AMF,DMF }
- {-----------------------------------------------------------------------}
- { The following modes are supported by the EV673: }
- { }
- {Evrx Extd Type Resolution Font Monitors }
- {========= ==== ========== ==== ======== }
- { 13h 256 color grfx 640x350(1,2) 8x14 AMF#2,DMF#2,EGA }
- { 14h 256 color grfx 640x400(1,2) 8x14 AMF#2,DMF#2 }
- { 15h 256 color grfx 512x480(1,2) 8x14 AMF,DMF }
- { (1) These modes have special memory organizations that require special}
- { programming. }
- { (2) When attached to a digital (TTL) monitor, these modes will only }
- { yield 64 colors from a fixed palette. }
- {-----------------------------------------------------------------------}
- { When writing programs for the 1280x600 mode, it is important to }
- { remember that the Miscellaneous Output register (3C2h) value is }
- { different for the EV673 and the EV659_2600. This value is used to }
- { select between page 0 and page 1 of the graphics screen memory. These}
- { values are given below: }
- { EV673 EV659_2600 }
- { ===== ========== }
- { Page 0 0B7h 0BBh }
- { Page 1 097h 09Bh }
- {-----------------------------------------------------------------------}
- { When writing programs for the hi-res 256 color modes on the EV673, }
- { software must manipulate the paging bits in 3C2/b5 and 3C4/8/b7. }
- { The read address of 3C2 is 3CC. These registers should be read }
- { back, modified, and written back so as not to modify other bits. }
- { 3C2/b5 3C4/8/b7 }
- { ====== ======== }
- { Page 0 1 0 }
- { Page 1 1 1 }
- { Page 2 0 0 }
- { Page 3 0 1 }
- {-----------------------------------------------------------------------}
- { This signature checking code scans through the first 4K of the ROM }
- { BIOS area at C000 looking for the string 'EVEREX SYSTEM INC.'. If }
- { this string is found, it looks at the 2 bytes immediately following }
- { the '.' -- these two bytes give the board number and revision number }
- { as shown below in the case statement table. By examining the value }
- { of 'board' and using the tables above, you can make a determination }
- { of the capabilities of EGA or VGA adapter. }
- {-----------------------------------------------------------------------}
-
- type
- BoardType = ( UNKNOWN, EV657_1, EV657_2, EV657_3, EV657_B, EV659,
- EV659_2600, EV659_2, EV673 );
- string255 = string[255];
- word = integer;
- registers = record
- case integer of
- 0 : ( ax,bx,cx,dx,bp,si,di,ds,es,flags : word );
- 1 : ( al,ah,bl,bh,cl,ch,dl,dh : byte );
- end;
-
- procedure WhichBoard;
-
- const
- EVSIGHDR = $5645;
- EVSIG = 'EVEREX SYSTEM INC.';
- var
- regs : registers;
- buf : string255;
- found : boolean;
- boardRev : word;
- ch : char;
- board : BoardType;
- monitor : word;
- i : integer;
-
- begin
- with regs do begin
- ah := $70; { EV673 Extended BIOS call }
- bx := 0;
- end; { with }
- intr ( $10, regs );
- if regs.al = $70 then begin
- board := EV673;
- {** monitor := regs.CL} { Get physical monitor type }
- { CL = 00h => TTL monochrome }
- { = 01h => CGA }
- { = 02h => EGA }
- { = 03h => TTL multi-freq #1 }
- { = 04h => TTL multi-freq #2 }
- { = 05h => Anlg multi #1 }
- exit; { = 06h => IBM PS/2 fixed }
- end; { if } { = 07h => Anlg multi #2 }
-
- i := 0;
- found := FALSE;
- board := UNKNOWN;
- while (i < $1000) and not(found) do begin
- if mem[$c000:i] = ord('E') then begin
- move ( mem[$c000:i], buf[1], length(EVSIG)+1 );
- buf[0] := chr(length(EVSIG));
- if buf = EVSIG then begin
- found := TRUE;
- boardRev := memw[$c000:i+length(EVSIG)];
- case boardRev of
- $5701 : board := EV657_1;
- $5702 : board := EV657_2;
- $5703 : board := EV657_3;
- $572B : board := EV657_3;
- $570B : board := EV657_B;
- $5901 : board := EV659;
- $5909 : board := EV659;
- $5902 : board := EV659_2;
- $5926 : board := EV659_2600;
- else begin
- if ( hi (boardRev)=$57 ) then board := EV657_3
- else if ( hi (boardRev)=$59 ) then board := EV659_2
- else board := UNKNOWN
- end;
- end; { case }
- end; { if }
- end; { if }
- i := i + 1;
- end; { for }
- end; { WhichBoard }
-
- {-----------------------------------------------------------------------}
-